'use strict'

const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware')
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware')
const path = require('path')
const config = require('../webpack.config')
const paths = require('./paths')

const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'
const host = process.env.HOST || '0.0.0.0'

module.exports = function(proxy,allowedHost){
    return{
        disableHostCheck: !proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true',
        compress:true,
        clientLogLevel:'none',
        contentBase:paths.appPublic,
        hot:true,
        publicPath:config.output.publicPath,
        //quiet:true
        https:protocol === 'https',
        host,
        overlay:false,

        //watchOptions:{
            //ignored:new RegExp(`^(?!)`)
        //}
        historyApiFallback:{
            disableDotRule:true,
        },
        public:allowedHost,
        proxy,

        //before(app){

        //}
    }
}